<!-- eslint-disable vue/multi-word-component-names -->
<template>
    <el-card>
        <div class="box">
            <img :src="userStore.userInfo.avatar" alt="">
            <div class="texts">
                <p class="name">{{ time +','+ userStore.userInfo.name }}</p> 
                <p class="title">硅谷甄选运营平台</p>
            </div>
        </div>
    </el-card>
</template>

<script lang="ts" setup>
    import { ref,onMounted } from 'vue'
    import useUserStore from '@/store/modules/user';
    const userStore = useUserStore();

    let time = ref('');
    onMounted(() => {
        let hour = new Date().getHours();
        if (hour >= 0 && hour < 6) {
            time.value = '早上好';
        } else if (hour >= 6 && hour < 12) {
            time.value = '上午好';
        } else if (hour >= 12 && hour <= 18) {
            time.value = '下午好';
        } else {
            time.value = '晚上好';
        }
    });
</script>

<style scoped lang="scss">
    .box{
        display: flex;
        align-items: center;

        img{
            width: 100px;
            height: 100px;
            border-radius: 50%;
        }

        .texts{
            margin-left: 20px;
            p{
                letter-spacing: 1px;
            }
            .name{
                font-size: 20px;
                font-weight: 600;
            }
            .title{
                font-size: 16px;
                color: skyblue;
                margin-top: 20px;
                font-style: italic;
            }
         }
    }
</style>